// Inline template with sidebar items markup and ng-directives
script(type='text/ng-template', id="sidebar-renderer.html")
  span(ng-if="item.heading") {{item.text}}
  a(ng-if="!item.heading", ng-href="{{$state.href(item.sref, item.params)}}", title="{{item.text}}")
    em(class="{{item.icon}}", ng-hide="inSubmenu")
    .label.label-success.pull-right(ng-if="item.alert") {{item.alert}}
    span {{item.text}}
  ul(class="nav sidebar-subnav", ng-if="item.submenu", collapse="isCollapse(pIndex)",  ng-init="addCollapse(pIndex, item)")
    li.sidebar-subnav-header {{item.text}}
    li(ng-repeat='item in item.submenu', ng-include="'sidebar-renderer.html'", ng-class="getMenuItemPropClasses(item)", ng-init="pIndex=(pIndex+'-'+$index); inSubmenu = true", ng-click="toggleCollapse(pIndex)")

// START Sidebar (left)
.aside-inner
  nav.sidebar(sidebar="")
    .brand-logo
      img.img-responsive(src="app/img/logo.jpg", alt="App Logo")
    // START sidebar nav
    ul.nav
      // Iterates over all sidebar items
      li(ng-class="getMenuItemPropClasses(item)", ng-repeat='item in menuItems', ng-init="pIndex = $index", ng-include="'sidebar-renderer.html'", ng-click="toggleCollapse(pIndex, true)")
    // END sidebar nav
// END Sidebar (left)